<?php

require_once dirname(__FILE__) . '/../Projet.class.php';
require_once dirname(__FILE__) . '/../Mission.class.php';
require_once dirname(__FILE__) . '/../Intervenant.class.php';

class ProjetTest extends PHPUnit_Framework_TestCase {

    protected $object;

    protected function setUp() {
        $this->object = new Projet('SynapsePHP', '10sept2012', '25sept2012', 10000);
        $i = new Intervenant('Lise', 100);
        $m1 = new Mission('specif', 'specifications et tests', 30, $i);
        $m1->ajoutReleve('lundi1009', 4);
        $m1->ajoutReleve('mercredi1209', 10);
        $m1->ajoutReleve('jeudi1309', 10);
        $this->object->ajoutMission($m1);
        $i = new Intervenant('Julien', 50);
        $m2 = new Mission('codage', 'implementation PHP', 80, $i);
        $m2->ajoutReleve('mercredi1209', 5);
        $m2->ajoutReleve('jeudi1309', 5);
        $this->object->ajoutMission($m2);
    }

    public function testCumulCoutMO() {
        $this->assertEquals(2500, $this->object->cumulCoutMO());
    }

    public function testMargeBruteCourante() {
        $this->assertEquals(7500, $this->object->margeBruteCourante());
    }

}

?>